package com.zm.demo.core.concurrent;

import java.util.concurrent.locks.LockSupport;

/**
 * @author zoum
 * @create 2019/12/12 17:12
 */
public class LockSupportTest {


    public static void main(String[] args){
        LockSupportTest test = new LockSupportTest();
        Thread t1 = new Thread(()->{
            LockSupport.park();
           System.out.println("t1 running.");
        });

        Thread t2 = new Thread(()->{
//            LockSupport.unpark(t1);
//            t1.interrupt();
           System.out.println("t1.isInterrupted() = " + t1.isInterrupted());
           System.out.println("t2 running.");
        });

        t1.start();
        t2.start();





    }
}
